Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Jan 10, 2026

This reverts commit 7111cbf, which in turn reverted cecc26b.

The regression is fixed by adding an additional fallback to a repo mapping lookup for the main repo to accommodate the tests in rules_cc and rules_java. The restructuring of the checks also results in a further improvement down to a 1% slowdown incurred by the checks (vs. 10-20% before this change).

This reverts commit 7111cbf, with an additional fallback to a repo mapping lookup for the main repo to accomodate the tests in rules_cc and rules_java.
@fmeum fmeum marked this pull request as ready for review January 10, 2026 13:00
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jan 10, 2026
@fmeum fmeum requested review from Wyverald, Copilot and hvadehra and removed request for hvadehra January 10, 2026 13:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR relands a previously reverted performance optimization that avoids expensive repository mapping lookups when checking builtin API access restrictions. The original regression has been fixed by adding a fallback to repo mapping lookup specifically for the main repository case to accommodate tests in rules_cc and rules_java.

Changes:

  • Introduced reposMatch() helper method that optimizes repository name matching by avoiding RepositoryMapping.get() calls in most cases
  • Replaced string-based comparison with constant-based comparison for the _builtins repository check
  • Added import for RepositoryName class

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fmeum
Copy link
Collaborator Author

fmeum commented Jan 10, 2026

@bazel-io fork 9.0.0

@meisterT meisterT added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jan 12, 2026
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jan 12, 2026
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Jan 12, 2026
This reverts commit 7111cbf, which in turn reverted cecc26b.

The regression is fixed by adding an additional fallback to a repo mapping lookup for the main repo to accommodate the tests in rules_cc and rules_java. The restructuring of the checks also results in a further improvement down to a 1% slowdown incurred by the checks (vs. 10-20% before this change).

Closes bazelbuild#28217.

PiperOrigin-RevId: 855249997
Change-Id: I7da63fa9d6727a771e94be86bf62e7a6f957cfc7
github-merge-queue bot pushed a commit that referenced this pull request Jan 12, 2026
…ns" (#28254)

This reverts commit 7111cbf, which in
turn reverted cecc26b.

The regression is fixed by adding an additional fallback to a repo
mapping lookup for the main repo to accommodate the tests in rules_cc
and rules_java. The restructuring of the checks also results in a
further improvement down to a 1% slowdown incurred by the checks (vs.
10-20% before this change).

Closes #28217.

PiperOrigin-RevId: 855249997
Change-Id: I7da63fa9d6727a771e94be86bf62e7a6f957cfc7

Commit
37fb3c5

Co-authored-by: Fabian Meumertzheim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants